@extends('admin::layouts.master')
@section('content')
    <div class="card" id="app">
        <div class="card-header">海报管理</div>
        <ul role="tablist" class="nav nav-tabs">
            <li class="nav-item"><a href="/mall/slider" class="nav-link">海报列表</a></li>
            <li class="nav-item"><a href="#" class="nav-link active">修改海报</a></li>
        </ul>
        <form action="/mall/slider/{{$slider['id']}}" method="post">
            <div class="card-body card-body-contrast">
                @csrf @method('PUT')
                <div class="form-group row">
    <label for="thumb" class="col-12 col-sm-3 col-form-label text-md-right">缩略图</label>
    <div class="col-12 col-lg-9">
        <hd-image name="thumb" id="thumb" image-url="{!! $slider['thumb']??old('thumb') !!}"></hd-image>
        @if ($errors->has('thumb'))
            <span class="text-danger">
                <strong>{{ $errors->first('thumb') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="link" class="col-12 col-sm-3 col-form-label text-md-right">链接</label>
    <div class="col-12 col-md-9">
        <input id="link" name="link" type="text"
               value="{{ $slider['link']??old('link') }}"
               class="form-control form-control-sm form-control{{ $errors->has('link') ? ' is-invalid' : '' }}">
        @if ($errors->has('link'))
            <span class="invalid-feedback" role="alert">
                <strong>{{ $errors->first('link') }}</strong>
            </span>
        @endif
    </div>
</div>
<div class="form-group row">
    <label for="isshow" class="col-12 col-sm-3 col-form-label text-md-right" style="padding-top:initial;">是否显示</label>
    <div class="col-12 col-md-9">
                    <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio"
                           {{old('isshow',$slider['isshow'])=='1'?'checked':''}}
                           name="isshow" value="1"
                           id="isshow-1">
                    <label class="form-check-label" for="isshow-1">是</label>
           </div>            <div class="form-check form-check-inline">
                    <input class="form-check-input" type="radio"
                           {{old('isshow',$slider['isshow'])=='2'?'checked':''}}
                           name="isshow" value="2"
                           id="isshow-2">
                    <label class="form-check-label" for="isshow-2">否</label>
           </div>
        <br>
        @if ($errors->has('isshow'))
            <span class="text-danger">
                <strong>{{ $errors->first('isshow') }}</strong>
            </span>
        @endif
    </div>
</div>

            </div>
            <div class="card-footer text-muted">
                <button class="btn btn-primary offset-sm-2">保存更新</button>
            </div>
        </form>
    </div>
@endsection
